home *** CD-ROM | disk | FTP | other *** search
/ Practical Web Pages 2004 September / PracticalWebPages-WPG13-09-2004-Coverdisc.iso / pc / Software / Toolkit / Sothink SWF Quicker 1.5 / data1.cab / Public_Files / Effects / ActionScript / Interactive / MagneticMouse2.sqe < prev   
Encoding:
Text File  |  2004-06-14  |  1.9 KB  |  69 lines

  1. ========== Description Part Begin ==========
  2. name = "Magnetic Mouse 2";
  3. description = "When you mouse over a character, the character will be magnetized and cause other characters to move as well.";
  4. version = "1.00";
  5. bin = "MagneticMouse2.bin";
  6. ========== Description Part End ==========
  7.  
  8. ========== Parameter Part Begin ==========
  9. $nCharacterCount(EDIT,INT,1,1 10000,"Total Characters ","The total characters using the special effect. The value is defined by the selected characters in the movie, but can not be changed in the property box.");
  10. $nFrameCount(EDIT,INT,3,3 3,"Total Frames","It indicates the total frames of actions. The total frames of the effect is probably more than it.");
  11. $nSize(EDIT,INT,200,100 1000,"Size","The maximun size of characters to be changed.");
  12.  
  13. ========== Parameter Part End ==========
  14.  
  15. ========== Function Part Begin ==========
  16. nCharacterCount = 4;
  17. nSize = 200;
  18.  
  19.  
  20. nOriginalSizeX = new Array(nCharacterCount);
  21. nOriginalSizeY = new Array(nCharacterCount);
  22. for (i = 1; i <= nCharacterCount; i++)
  23. {
  24.         nOriginalSizeX[i - 1] = this["c" + i ]._xscale;
  25.         nOriginalSizeY[i - 1] = this["c" + i ]._yscale;
  26. }
  27.  
  28.  
  29.  
  30. function fun(tar, accel, convert,i) 
  31. {     
  32.         xScale = xScale * accel + (tar - this["c" +i]._xscale) * convert; 
  33.         yScale = yScale * accel + (tar - this["c" +i]._yscale) * convert; 
  34.         this["c" +i]._xscale += xScale; 
  35.         this["c" +i]._yscale += yScale;
  36. }
  37.  
  38.  
  39. function funChangeSize()
  40. {
  41.     
  42.     for( n = 1; n <= nCharacterCount;n++)
  43.     {
  44.         
  45.         if(this["c" + n].hitTest(_root._xmouse,_root._ymouse,false))
  46.         {
  47.             fun(nSize,0.7,0.4,n);
  48.         }
  49.         else
  50.         if (!this["c" + n].hitTest(_root._xmouse,_root._ymouse,false))
  51.         {
  52.                 fun(nOriginalSizeX[0],0.7,0.4,n);
  53.     
  54.         }
  55.         
  56.     }
  57.  
  58. }
  59.  
  60. function again()
  61. {
  62.     gotoAndPlay(2);
  63. }
  64. ========== Function Part End ==========
  65.  
  66. ========== Frame Part Begin ==========
  67. $frame(funChangeSize,2,-1,"funChangeSize");
  68. $frame(again,3,-1,"again");
  69. ========== Frame Part End ==========